Here, we want to add edge weights to our graph embedding and see how that affects visualizations.

Setup and get data from scVelo

Use the reticulate package to use scVelo from within R:

Make fdg embedding

Extract count data..

Filter genes

Downsample cells to make things easier

Normalize for dimensional reduction

## Warning in if (!class(counts) %in% c("dgCMatrix", "dgTMatrix")) {: the condition
## has length > 1 and only the first element will be used
## Converting to sparse matrix ...
## Normalizing matrix with 1232 cells and 8724 genes

Dimensional reduction

Run velocyto on panc data

Scores of observed and projected states in PC space

Graph visualization on subset of cells from PC coordinates

Adding edge weights

Here, I’m using the composite distances as edge weights.
Negative edge weights messes with the graph layout. In this case, because our similarity is 0.25, all of our composite distances are negative. So I took just took the abs value of composite distances. Probably need to figure out a better way to deal with negative edge weights…

Distribution of pairwise composite distance amongst all k nearest neighbors:

Compare consistency scores